package com.bnlr.lrparking.appui.mine.recentparkrecord;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.bnlr.lrparking.R;
import com.bnlr.lrparking.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * description: 小票提交结果页面
 * SubmitReceiptResultActivity class
 *
 * @author : Licy
 * @date : 2018/12/26
 */
public class SubmitReceiptResultActivity extends BaseActivity {


    @BindView(R.id.tv_nav_title)
    TextView tvNavTitle;

    @BindView(R.id.iv_nav_back)
    ImageView ivNavBack;

    @BindView(R.id.img_upload_result)
    ImageView imgUploadResult;
    @BindView(R.id.tv_upload_result)
    TextView tvUploadResult;
    @BindView(R.id.btn_re_upload)
    Button btnReUpload;

    public boolean result;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_submitreceiptresult);
        ButterKnife.bind(this);

        result = getIntent().getBooleanExtra("result", true);

        refreshView();
    }

    public void initView() {
        tvNavTitle.setText("上传结果");
    }

    public void initListener() {

        btnReUpload.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }


    public void refreshView(){
        if (result){
            imgUploadResult.setImageResource(R.mipmap.pay_seccess);
            tvUploadResult.setText("小票上传成功，我们将会在1~3个工作日\n返回审核结果，请耐心等待！");
            btnReUpload.setText("完成");
        }else {
            imgUploadResult.setImageResource(R.mipmap.icon_pay_fail);
            tvUploadResult.setText("上传失败！");
            btnReUpload.setText("重新上传");
        }
    }

}
